Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding to JPEG transfer syntaxes #303

Merged
merged 10 commits into from
Jul 23, 2023
Merged

Conversation

Almeida-a
Copy link
Contributor

@Almeida-a Almeida-a commented Oct 25, 2022

This is a first version of an implementation regarding issue #286.

It it not tested yet, however, any suggestion regarding that, or other mistakes, would be appreciated!


Depends on #361

Copy link
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this. Please follow the suggestions inline to resolve the current issues.

Also, the format does not look standard. Running cargo fmt on the file should fix this.


As for the testing, we are missing a PixelDataObject implementation in this context. Let's devise a struct that keeps the necessary attributes in memory, then we can think of a way to construct them from test files.

@Enet4 Enet4 added enhancement A-lib Area: library labels Nov 2, 2022
@Almeida-a
Copy link
Contributor Author

Right now I just need to finish the unit tests, but since I am encountering some errors and I am still a beginner in rust, I'm taking longer to complete the rest of this pr (sorry for that); but if at any point there is a need to more quickly finish this, I can commit my work up until this point.

@Enet4
Copy link
Owner

Enet4 commented Jun 10, 2023

Hey @Almeida-a, don't worry. As I intend to change the pixel data adapter API soon, it might be worth stalling this a bit more while I set up the new design, then we can work together on migrating the implementations. I hope that this works for you.

@Enet4
Copy link
Owner

Enet4 commented Jun 10, 2023

Update: #361 is what I have in mind. When you have the time, please rebase this branch against it and try to adjust the implementation. Feel free to ask if you need any help.

@Enet4 Enet4 force-pushed the new/jpeg-encoding branch from 0dc718b to 8b4954b Compare July 8, 2023 15:05
@Enet4
Copy link
Owner

Enet4 commented Jul 8, 2023

I took the liberty of rebasing this PR on top of #361 to start trying things out. I also took care of error handling in the encoder. Next I believe that this would call for a test suite to cover converting some pixel data to JPEG and back.

@Enet4 Enet4 force-pushed the new/jpeg-encoding branch from 82cf0fe to ce7c355 Compare July 22, 2023 12:23
@Enet4
Copy link
Owner

Enet4 commented Jul 22, 2023

New stuff:

  • Fixed some calculations being done at u16 instead of usize, which would lead to overflow in medium/large resolutions.
  • Added a test suite for writing and reading JPEG directly with adapters.

I found a few more things worth addressing at #361, but the changes to be made here should be minimal. I will take care of rebasing afterwards.

@Enet4 Enet4 force-pushed the new/jpeg-encoding branch from be6151e to eb1b14d Compare July 22, 2023 15:40
@Enet4
Copy link
Owner

Enet4 commented Jul 22, 2023

@Almeida-a Can you have a look and see if the new changes make sense to you? It should hopefully be ready to merge soon.

@Almeida-a
Copy link
Contributor Author

On it!

Copy link
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me now. I will just wait for your signal. 👍

@Almeida-a
Copy link
Contributor Author

Looks good, thank you for your assistance!

Almeida-a and others added 10 commits July 23, 2023 10:00
- this is the only supported TS for encoding right now
- leave note that support for other JPEG TSes is not complete
- add adapter utils and TestPixelData
- fixes overflow on large resolutions
- add dicom-test-files as a dev dependency
- add tests/jpeg.rs test suite
   - reading jpeg baseline and jpeg lossless
   - write & read cycle
- to include dependency of dicom-transfer-syntax-registry
  on dicom-test-files
@Enet4 Enet4 force-pushed the new/jpeg-encoding branch from eb1b14d to fa0316b Compare July 23, 2023 09:01
@Enet4
Copy link
Owner

Enet4 commented Jul 23, 2023

Great! Thank you for the initiative and commitment, @Almeida-a!

@Enet4 Enet4 merged commit affdbc6 into Enet4:master Jul 23, 2023
@Enet4 Enet4 mentioned this pull request Oct 25, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants